﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;

namespace SploreServer.Data.Common
{
    [DataContract]
    public class ResultPackage<T>
    {
        [DataMember]
        public T Result { get; set; }
        [DataMember]
        public string ResultMessage { get; set; }

        private ResultPackage() { }

        public ResultPackage(T theResult)
            : this(theResult, string.Empty)
        {
        }
        public ResultPackage(T theResult, string theResultMessage)
        {
            Result = theResult;
            ResultMessage = theResultMessage;
        }
    }

    [DataContract]
    public class ResultPackage<T,U>:ResultPackage<T>
    {
        [DataMember]
        public U Package { get; set; }


        public ResultPackage(T theResult, U thePackage)
            : this(theResult, string.Empty, thePackage)
        {
        }

        public ResultPackage(T theResult, string theResultMessage, U thePackage):base(theResult,theResultMessage)
        {
            Package = thePackage;
        }
    }
}